﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Templates/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ModuleList.aspx.cs" Inherits="VIT.Web.Admin.ModuleList" %>
<%@ Register Assembly="VIT.Web.Controls" Namespace="VIT.Web.Controls" TagPrefix="VIT" %>

<asp:Content ID="HeadContent" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="<%=URLRoot %>Admin/Includes/VIT.js"></script>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
<form id="aspnetForm" runat="server">

    <div>
        <div class="select">
            Ngôn ngữ: <asp:DropDownList ID="ddlLang" runat="server" AutoPostBack="True" onselectedindexchanged="ddlLang_SelectedIndexChanged"></asp:DropDownList>
        </div>
        <div class="toolbar">
            <VIT:Submit ID="btInsert" runat="server" Function="Module_Insert" ToolTip="Thêm" CssClass="icon-32-add" BorderStyle="None" OnClick="insert_Click"/>
            <VIT:Submit ID="btPublished" runat="server" Function="Module_Modify" ToolTip="Bật" CssClass="icon-32-apply" BorderStyle="None" OnClick="btPublished_Click" OnClientClick="return hasCheck('itemCheckbox','Vui lòng chọn liên kết để bật');"/>
            <VIT:Submit ID="btUnPublished" runat="server" Function="Module_Modify" ToolTip="Tắt" CssClass="icon-32-unapply" BorderStyle="None" OnClick="btUnPublished_Click" OnClientClick="return hasCheck('itemCheckbox','Vui lòng chọn liên kết để tắt');"/>
            <VIT:Submit ID="btDelete" runat="server" Function="Module_Delete" ToolTip="Xóa" CssClass="icon-32-delete" BorderStyle="None" OnClick="btDelete_Click" OnClientClick="return hasCheck('itemCheckbox','Vui lòng chọn liên kết để xóa') && confirm('Xóa Module được chọn');"/>
        </div>
    </div>
    <div class="clr"></div>

    <div>
        <table>
            <thead>
	            <tr>
		            <th width="2%">#</th>
		            <th width="2%">
			            <input type="checkbox" name="toggle" id="toggle" onclick="checkAll('toggle', 'itemCheckbox')"/>
	                </th>
	                <th>Name</th>
                    <th>Tiêu đề</th>
                    <th>Tham số</th>
                    <th><VIT:LinkSubmit ID="lblTemplate" runat="server" Param="TemplateName" ViewStateMode="Disabled" OnClick="sortedChange_OnClick">Template</VIT:LinkSubmit></th>
                    <th>Vị trí trên Template</th>
                    <th><VIT:LinkSubmit ID="lblComponent" runat="server" Param="ComponentName" ViewStateMode="Disabled" OnClick="sortedChange_OnClick">Component</VIT:LinkSubmit></th>
                    <th><VIT:LinkSubmit ID="lblView" runat="server" Param="ViewName" ViewStateMode="Disabled" OnClick="sortedChange_OnClick">View</VIT:LinkSubmit></th>
                    <th>Vị trí trên Component</th>
		            <th><VIT:LinkSubmit ID="lblOrder" runat="server" Param="Orders" ViewStateMode="Disabled" OnClick="sortedChange_OnClick">Thứ tự</VIT:LinkSubmit></th>
		            <th><VIT:LinkSubmit ID="lblPublished" runat="server" Param="Published" ViewStateMode="Disabled" OnClick="sortedChange_OnClick">Hiển thị</VIT:LinkSubmit></th>
                    <th>ID</th>
		            <th width="5%">Sửa</th>
	            </tr>			
            </thead>
            <tbody>
                <asp:Repeater ID="rpt" runat="server">
		            <ItemTemplate>
		            <tr class="row<%#Container.ItemIndex%2 %>">
		            <td align="center"><%#Container.ItemIndex %></td>
	                    <td align="center">
		                    <input type="checkbox" name="itemCheckbox" value="<%#Eval("Id")%>" />
                        </td>
                        <td align="left"><%#Eval("Name")%></td>
	                    <td align="left"><%#Eval("Title")%></td>
	                    <td align="left"><%#Eval("Param")%></td>
                        <td align="left"><%#Eval("TemplateName")%></td>
                        <td align="left"><%#Eval("TemplatePosition")%></td>
                        <td align="left"><%#Eval("ComponentName")%></td>
                        <td align="left"><%#Eval("ViewName")%></td>
                        <td align="left"><%#Eval("ComponentPosition")%></td>
	                    <td align="center">
                            <VIT:LinkSubmit ID="btnOrderUp" Function="Module_Modify" OnClick="updateOrder_Click" CssClass="btn" runat="server" Param='<%#Eval("Id")+"|-"%>'><img src="<%=URLRoot %>Admin/Includes/icons/uparrow.png"/></VIT:LinkSubmit>
                            <span><%#Eval("Orders")%></span>
                            <VIT:LinkSubmit ID="btnOrderDown" Function="Module_Modify" OnClick="updateOrder_Click" CssClass="btn" runat="server" Param='<%#Eval("Id")+"|+"%>'><img src="<%=URLRoot %>Admin/Includes/icons/downarrow.png"/></VIT:LinkSubmit>
                        </td>
	                    <td align="center">
                            <VIT:LinkSubmit ID="changePublish" Function="Module_Modify" OnClick="changePublish_Click" runat="server" Param='<%#Eval("Id")+"|"+Eval("Published")%>'>
                                <img alt="<%#Eval("Published")%>" src="<%#URLRoot+(Eval("Published").ToString() == "True" ? "Admin/Includes/icons/tick.png" : "Admin/Includes/icons/publish_x.png")%>" />
                            </VIT:LinkSubmit>
                        </td>
		                <td align="center"><%#Eval("id")%></td>	
                        <td align="center"><a href='ModuleEdit.aspx?sId=<%#Eval("id")%>&sLang=<%=currentLang %>'>Sửa</a></td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            </tbody>
        </table>
    </div>
</form>
    <script type="text/javascript">
        $("#aside ul li#ModuleList").addClass("submenu-active");
    </script>
</asp:Content>
